package com.qf.mapper;

import com.qf.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author fy
 * @version V1.0
 * @Project workspace
 * @Package com.qf.mapper
 * @Description:
 * @Date 2022/6/2 0:34
 */
public interface UserMapper {
    /**
     * 查找全部数据
     * @return
     */
    public List<User> findUserAll();
    /**
     * 根据主键id查询
     * @param id
     * @return
     */
    public User findUserById(Integer id);

    /**
     * 根据名字模糊查询
     * @param name
     * @return
     */
    public List<User> findByName(String name);

    /**
     * 添加
     * @param user
     */
    public void insertUser(@Param("user") User user);

    /**
     * 修改
     * @param user
     */
    public void updateUser(@Param("user")User user);

    /**
     * 根据主键id删除
     * @param id
     */
    public void deleteUserById(@Param("id") Integer id);

    /**
     * 查找用户和用户详情
     * @return
     */
    public List<User> findUserAndUserDesc();

    public List<User> findUserAndOrder();

    public List<User> findUserAndOrderAndProduct();

    public List<User> findUserByIds(@Param("ids") List<Integer> ids);

    public List<User> findUserByNameAndSex(@Param("name")String name,@Param("sex")String sex);

    public List<User> findUserAllCacheOne();
}
